package com.chaos.eurekaproducer.test;

/**
 * @author liaopeng
 * @title: FinallyDemo
 * @projectName eureka-producer
 * @description: try或catch中有return时，如果有finally，那么先执行finally再return
 * @date 2021/9/13下午5:49
 */
public class FinallyDemo {

    public static void main(String[] args) {
        testFinally();
    }

    public static String testFinally(){
        try {
            int m=1/0;
            return "try块return";
        }catch (Exception e){
            return "catch块return";
        }finally {
            System.out.println("finally执行了！");
        }

    }
}
